/***************************************************************************************************
*	file name:	common_typedef.h
*	created:	2008-11-23
*	author:		teras xiao
*	version:	1.0
*	purpose:	
*
*	revision:
*
***************************************************************************************************/


#ifndef _COMMON_TYPEDEF_H_
#define _COMMON_TYPEDEF_H_


#ifdef __GNUC__
#include <stdint.h>
#include <inttypes.h>
#endif



typedef  void (*DoLastJob)(void*);

#include <sstream>
#include <fstream>
#include <string>

#ifdef DEBUG
#define Assert(exp, message)\
{\
	if (!(exp))\
{ \
	std::stringstream ss;\
	ss<<"Assertion failed: " <<#exp<< "\n" \
	<< "Message: " << message << "\n" \
	<< "line: " << __LINE__ << "\n" \
	<< "file: " << __FILE__ << "\n"; \
	std::ofstream out("coredump_log.txt",std::ios_base::app);\
	out<<ss.str().c_str();\
	out.close();\
	int i = 10/0;\
	exit(EXIT_FAILURE); \
} \
}
#else
#define Assert(exp, message)
#endif


#endif


